#dyn.unload("resample.so")
dyn.load("resample.so")
Rsample<-function(N,prob,X) .C("Rsample",as.integer(N),as.double(prob),as.double(X),as.double(rep(0,N)))[[4]]

